From: Florian Müllner Date: Thu, 4 Jan 2024 13:39:45 +0000 (+0100) Subject: mountOperation: Close when drive gets disconnected X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~156 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=723ccb70eeac2980732de1161fed55c8e4176bbe;p=gnome-shell.git mountOperation: Close when drive gets disconnected If the volume that corresponds to the mount operation has an associated drive, we should withdraw any pending dialogs or notifications when the drive gets physically disconnected, as they've become obsolete. Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7302 Part-of: --- diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js index 84f8ad631..caef313af 100644 --- a/js/ui/shellMountOperation.js +++ b/js/ui/shellMountOperation.js @@ -74,6 +74,10 @@ export class ShellMountOperation { this.close.bind(this)); this.mountOp.connect('show-unmount-progress', this._onShowUnmountProgress.bind(this)); + + this._drive = source.get_drive(); + this._drive?.connectObject('disconnected', + this.close.bind(this), this); } _closeExistingDialog() { @@ -141,6 +145,11 @@ export class ShellMountOperation { this._notifier.done(); this._notifier = null; } + + if (this._drive) { + this._drive.disconnectObject(this); + this._drive = null; + } } _onShowProcesses2(op) {